[PDF] Analyzing Performance and Costs of Reactive Programming Libraries in Java
Comparison Results
I know everyone prefers to see results rather than the comparison process.
Code Metrics for Reactive Programming Libraries Using scc (Excluding Tests and Documentation)
| Library | Java Lines of Code (LOC) | Number of Files | Cyclomatic Complexity (CC) | Cyclomatic Complexity Density (CC/KLOC)[3] |
|---|---|---|---|---|
| RxJava 3.0.13 | 100313 | 907 | 11750 | 117.13 |
| Reactor 3.4.8 | 72858 | 444 | 13358 | 183.34 |
| Mutiny 1.0.0 | 21177 | 300 | 2840 | 134.10 |
Cyclomatic Complexity: A metric that measures the complexity of a program's control flow, primarily used to evaluate code complexity and maintainability. It was proposed by Thomas J. McCabe in 1976 to measure the number of independent paths in a program, i.e., the number of different possible execution paths in the code. Lower values are generally better.
Cyclomatic Complexity Density is an extension of Cyclomatic Complexity (CC), used to evaluate the ratio of code complexity relative to code volume. It helps identify the distribution of complexity relative to scale in code, providing better understanding of code quality and maintainability.
Single Operator Performance Comparison
Higher is better
| Single Operation Pipelines | |
|---|---|
| RxJava | Mono |
| Reactor | Single, Maybe, Completable |
| Mutiny | Uni |
| Individual Operators | Operators | |
|---|---|---|
| RxJava | Single | map |
| Reactor | Mono | map |
| Mutiny | Uni | chain |

Single Direct Transformation
Higher is better

Multiple Independent Operators
Higher is better

Stream Direct Transformation
Higher is better

Text Processing
Lower is better

Text Processing 2
Lower is better

Network Requests
Lower is better

Network Requests 2
Lower is better
